#include <iostream>
using namespace std;

template<typename T>
void Swap( T& a, T& b)
{
	T temp;
	temp = a;
	a = b;
	b = temp;
	
}



int main()
{
	//int
	int a = 4, b = 5;
	cout << "pre:" << a <<" " << b << endl;
	Swap(a, b);
	cout << "aft:" << a <<" " << b << endl;
	//doble
	double x = 3.14, y = 6.19;
	cout << "pre:" << x << " " << y << endl;
	Swap(x, y);
	cout << "aft:" << x << " " << y << endl;
	//char
	char p = 'a', t = 'b';
	cout << "pre:" << p << " " << t<< endl;
	Swap(p, t);
	cout << "pre:" << p << " " << t << endl;

	char l = '1', o = '0';
	cout << "pre:" << l << " " << o << endl;
	Swap(l, o);
	cout << "pre:" << l << " " << o << endl;
	return 0;
}